package com.belf.console.service.impl;

import com.belf.common.utils.DateUtils;
import com.belf.console.domain.DataCdcConf;
import com.belf.console.mapper.DataCdcConfMapper;
import com.belf.console.service.IDataCdcConfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * CDC配置Service业务层处理
 * 
 * @author belf
 * @date 2024-06-20
 */
@Service
public class DataCdcConfServiceImpl implements IDataCdcConfService 
{
    @Autowired
    private DataCdcConfMapper dataCdcConfMapper;

    /**
     * 查询CDC配置
     * 
     * @param id CDC配置主键
     * @return CDC配置
     */
    @Override
    public DataCdcConf selectDataCdcConfById(Long id)
    {
        return dataCdcConfMapper.selectDataCdcConfById(id);
    }

    /**
     * 查询CDC配置列表
     * 
     * @param dataCdcConf CDC配置
     * @return CDC配置
     */
    @Override
    public List<DataCdcConf> selectDataCdcConfList(DataCdcConf dataCdcConf)
    {
        return dataCdcConfMapper.selectDataCdcConfList(dataCdcConf);
    }

    /**
     * 新增CDC配置
     * 
     * @param dataCdcConf CDC配置
     * @return 结果
     */
    @Override
    public int insertDataCdcConf(DataCdcConf dataCdcConf)
    {
        dataCdcConf.setCreateTime(DateUtils.getNowDate());
        return dataCdcConfMapper.insertDataCdcConf(dataCdcConf);
    }

    /**
     * 修改CDC配置
     * 
     * @param dataCdcConf CDC配置
     * @return 结果
     */
    @Override
    public int updateDataCdcConf(DataCdcConf dataCdcConf)
    {
        dataCdcConf.setUpdateTime(DateUtils.getNowDate());
        return dataCdcConfMapper.updateDataCdcConf(dataCdcConf);
    }

    /**
     * 批量删除CDC配置
     * 
     * @param ids 需要删除的CDC配置主键
     * @return 结果
     */
    @Override
    public int deleteDataCdcConfByIds(Long[] ids)
    {
        return dataCdcConfMapper.deleteDataCdcConfByIds(ids);
    }

    /**
     * 删除CDC配置信息
     * 
     * @param id CDC配置主键
     * @return 结果
     */
    @Override
    public int deleteDataCdcConfById(Long id)
    {
        return dataCdcConfMapper.deleteDataCdcConfById(id);
    }
}
